/*******************************************************************************
 * Copyright (c) 2007 Benjamin Muskalla and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 * Benjamin Muskalla - initial API and implementation
 *******************************************************************************/
package de.bmuskalla.brainfuck.ui.editor.editors;

import org.eclipse.jface.text.rules.IWordDetector;

public class BFCommandDetector implements IWordDetector {

	private char command;

	/**
	 * @param command
	 */
	public BFCommandDetector(char command) {
		super();
		this.command = command;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.eclipse.jface.text.rules.IWordDetector#isWordPart(char)
	 */
	public boolean isWordPart(char c) {
		return c == command;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.eclipse.jface.text.rules.IWordDetector#isWordStart(char)
	 */
	public boolean isWordStart(char c) {
		return c == command;
	}

}
